#include "../../source/client/rpc_client.hpp"
#include "../../source/common/log.hpp"

int main()
{
    JsonMuduoRPC::client::TopicClient::ptr client =
        std::make_shared<JsonMuduoRPC::client::TopicClient>("127.0.0.1", 8080);

    bool ret = client->create("music");
    if (ret == false)
    {
        LOG(JsonMuduoRPC::ERROR, "主题创建失败");
        return 1;
    }
    for (int i = 0; i < 10; i++)
    {
        client->publish("music", std::string("music - ") + std::to_string(i + 1));
    }

    client->shutdown();
    return 0;
}